<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="/assets/lib/layui/css/layui.css">
    <link rel="stylesheet" href="/assets/lib/cropper/cropper.css">
    <link rel="stylesheet" href="/assets/css/article/add.css">
    <title>Document</title>
</head>

<body>
    <div class="layui-card">
        <div class="layui-card-header">写文章</div>
        <div class="layui-card-body">
            <form class="layui-form" action="">
                <div class="layui-form-item">
                    <label class="layui-form-label">文章标题</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">文章类别</label>
                    <div class="layui-input-block">
                        <select name="cate_id" lay-verify="required" class="city">
                           <option value=""></option>
                      </select>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label name="content" class="layui-form-label">文章内容</label>
                    <div class="layui-input-block">
                        <textarea id="demo" style="display: none;"></textarea>

                    </div>
                </div>


                <div class="layui-form-item">
                    <label class="layui-form-label">文章封面</label>
                    <div class="layui-input-block">
                        <div class="htmleaf-container">

                            <!-- Content -->
                            <div class="container">
                                <div class="row">
                                    <div class="col-md-9">
                                        <!-- <h3 class="page-header">Demo:</h3> -->
                                        <div class="img-container">
                                            <img id="avarImage" src="/assets/images/sample.jpg" alt="Picture">
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <!-- <h3 class="page-header">Preview:</h3> -->
                                        <div class="docs-preview clearfix">
                                            <div class="img-preview preview-lg"></div>
                                            <p>
                                                <button type="button" class="layui-btn layui-btn-danger confile">选择封面</button>
                                            </p>
                                        </div>

                                        <!-- <h3 class="page-header">Data:</h3> -->

                                    </div>
                                </div>
                                <div class="upload-button">
                                    <input type="file" name="cover_img" style="display: none;">
                                    <button type="button" class="layui-btn" lay-submit lay-filter="send">上传</button>
                                    <button type="button" class="layui-btn layui-btn-primary " lay-submit lay-filter="cg">存为草稿</button>
                                </div>
                            </div>
                            <!-- Alert -->

                        </div>
                    </div>
                </div>

            </form>
        </div>
    </div>
</body>

</html>
<script src="/assets/lib/jquery.js"></script>
<script src="/assets/lib/cropper/cropper.min.js"></script>
<script src="/assets/lib/layui/layui.all.js"></script>
<script src="/assets/js/common.js"></script>
<script>
    let layedit = null
    let index = null
    layui.use('layedit', function() {
        layedit = layui.layedit;
        index = layedit.build('demo'); //建立编辑器
    });
</script>
<script src="/assets/js/article/add.js"></script>